package de.alfenory.autobill.entity;

import java.util.Objects;

/**
 *
 * @author alefen
 */
public class AutobillDetail {
    String partsId;
    String description;
    double quantity;
    double price;
    double tax;
    Integer sourceId;

    public Integer getSourceId() {
        return sourceId;
    }

    public void setSourceId(Integer sourceId) {
        this.sourceId = sourceId;
    }
    
    public String getDescription() {
        return description;
    }

    public String getPartsId() {
        return partsId;
    }

    public double getPrice() {
        return price;
    }

    @Override
    public String toString() {
        return "AutobillDetail{" + "partsId=" + partsId + ", description=" + description + ", quantity=" + quantity + ", price=" + price + ", tax=" + tax + ", sourceId=" + sourceId + '}';
    }

    public double getQuantity() {
        return quantity;
    }

    public double getTax() {
        return tax;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setPartsId(String partsId) {
        this.partsId = partsId;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setQuantity(double quantity) {
        this.quantity = quantity;
    }

    public void setTax(double tax) {
        this.tax = tax;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 97 * hash + Objects.hashCode(this.partsId);
        hash = 97 * hash + Objects.hashCode(this.description);
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.quantity) ^ (Double.doubleToLongBits(this.quantity) >>> 32));
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.price) ^ (Double.doubleToLongBits(this.price) >>> 32));
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.tax) ^ (Double.doubleToLongBits(this.tax) >>> 32));
        hash = 97 * hash + Objects.hashCode(this.sourceId);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AutobillDetail other = (AutobillDetail) obj;
        if (!Objects.equals(this.partsId, other.partsId)) {
            return false;
        }
        if (!Objects.equals(this.description, other.description)) {
            return false;
        }
        if (Double.doubleToLongBits(this.quantity) != Double.doubleToLongBits(other.quantity)) {
            return false;
        }
        if (Double.doubleToLongBits(this.price) != Double.doubleToLongBits(other.price)) {
            return false;
        }
        if (Double.doubleToLongBits(this.tax) != Double.doubleToLongBits(other.tax)) {
            return false;
        }
        if (!Objects.equals(this.sourceId, other.sourceId)) {
            return false;
        }
        return true;
    }

       
}
